package com.situ.student.controller;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.situ.student.entity.Banji;
import com.situ.student.service.IBanjiService;
import com.situ.student.service.impl.BanjiServiceImpl;

public class BanjiController extends HttpServlet{
	private IBanjiService banjiService = new BanjiServiceImpl();

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws UnsupportedEncodingException  {
		//post请求乱码问题，放在service方法最上面
		req.setCharacterEncoding("utf-8");
		String method = req.getParameter("method");
		switch (method) {
		case "insert":
			insert(req, resp);
			break;
		default:
			break;
		}
	}

	private void insert(HttpServletRequest req, HttpServletResponse resp) {
		String name = req.getParameter("name");
		String age = req.getParameter("age");
		String gender = req.getParameter("gender");
	}
	
	
}
